"""
Explicit solver implementations
"""

"""
    ExplicitEulerSolver <: AbstractSolver

Simple forward Euler time stepping.
"""
struct ExplicitEulerSolver <: AbstractSolver
    dt::Float64
    
    ExplicitEulerSolver(; dt=0.01) = new(dt)
end

function solve_pde(solver::ExplicitEulerSolver, pde::AbstractPDE, initial_state, t_span, tracker, storage; kwargs...)
    if isa(t_span, Number)
        t_span = (0.0, t_span)
    end
    
    state = deepcopy(initial_state)
    t = t_span[1]
    
    while t < t_span[2]
        # Track current state
        if tracker !== nothing
            track!(tracker, state, t)
        end
        
        # Store current state  
        if storage !== nothing
            save_field(storage, state, t)
        end
        
        # Compute evolution rate
        rate = evolution_rate(pde, state, t)
        
        # Euler step
        state = state + solver.dt * rate
        t += solver.dt
        
        if t > t_span[2]
            t = t_span[2]
        end
    end
    
    return state
end

# Aliases for compatibility
const ImplicitEulerSolver = ExplicitEulerSolver
const RungeKuttaSolver = ExplicitEulerSolver
const AdamsBashforthSolver = ExplicitEulerSolver 
const CrankNicolsonSolver = ExplicitEulerSolver